﻿using System;
using System.Web;
using System.Configuration;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Linq;


namespace iResume
{
    /// <summary>
    /// Summary description for recruiterDisplayImage
    /// </summary>
    public class jobSeekerDisplayImg : IHttpHandler
    {
        static string CONNECTIONSTRING = ConfigurationManager.ConnectionStrings["iResumeConnectionString"].ToString();
        public void ProcessRequest(HttpContext context)
        {
            string id;
            if (context.Request.QueryString["id"] != null)
            {

                id = (context.Request.QueryString["id"]);
            }
            else
            {
                throw new ArgumentException("No parameter specified");
            }
            context.Response.ContentType = "image/jpeg";
            context.Response.ContentType = "image/png";
            context.Response.ContentType = "image/gif";
            context.Response.ContentType = "image/tiff ";
            context.Response.ContentType = "image/jpg ";
            Stream strm = DBManager.DisplayImagejs(id);
            byte[] buffer = new byte[2048];
            int byteSeq = strm.Read(buffer, 0, 888);
            while (byteSeq > 0)
            {
                context.Response.OutputStream.Write(buffer, 0, byteSeq);
                byteSeq = strm.Read(buffer, 0, 888);
            }

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}